# 使用列表存储宿舍成员
roommates = ['阮晓', '陈晓铭', '覃碧瑶']

# 使用元组表示每个成员的基本信息 (年龄, 专业)
basic_info = {
    '阮晓': (20, '计算机科学'),
    '陈晓铭': (21, '电子工程'),
    '覃碧瑶': (20, '数学')
}

# 使用字典存储联系方式
contacts = {
    '阮晓': {'电话': '12312312312', '邮箱': 'ruanxiao@123.com'},
    '陈晓铭': {'电话': '14564564564', '邮箱': 'chenxiaoming@123.com'},
    '覃碧瑶': {'电话': '17777777777', '邮箱': 'qinbiyao@123.com'}
}

# 使用集合存储爱好（集合自动去重）
hobbies = {
    '阮晓': {'编程', '篮球', '看电影'},
    '陈晓铭': {'电子游戏', '音乐', '编程'},
    '覃碧瑶': {'阅读', '数学建模', '跑步'}
}


# 综合展示宿舍信息
def display_dormitory_info():
    print("=" * 30)
    print("宿舍信息总览")
    print("=" * 30)

    for roommate in roommates:
        print(f"姓名: {roommate}")
        age, major = basic_info[roommate]
        print(f"年龄: {age}, 专业: {major}")
        print(f"电话: {contacts[roommate]['电话']}, 邮箱: {contacts[roommate]['邮箱']}")
        print(f"爱好: {', '.join(hobbies[roommate])}")
        print("-" * 30)


# 查找共同爱好
def find_common_hobbies():
    if not roommates:
        return set()

    common = hobbies[roommates[0]].copy()
    for roommate in roommates[1:]:
        common.intersection_update(hobbies[roommate])

    return common


# 执行展示
if __name__ == "__main__":
    display_dormitory_info()

    common = find_common_hobbies()
    if common:
        print(f"\n大家的共同爱好: {', '.join(common)}")
    else:
        print("\n大家没有共同爱好")